from flask.blueprints import Blueprint
from flask_restful import Api
#路由
from . import views

# 1. 创建蓝图实例对象
user_bp=Blueprint('user_bp',__name__,url_prefix='/app/v1_0')
# 2. 创建Api实例对象
user_api=Api(user_bp)








# 发送短信验证码
user_api.add_resource(views.UserResouce,'/sms/codes/<mobile>')

# 登录注册获取的token，以及登录
user_api.add_resource(views.AuthorizationResource, '/authorizations')


#用户中心
user_api.add_resource(views.Userinfo,'/user')

# 获取频道列表
user_api.add_resource(views.Channels,'/channels')

# 频道的增删改查
user_api.add_resource(views.UserChannleView,'/user/channels')

# 文章列表
user_api.add_resource(views.Articles,'/articles')


#文章详情页
user_api.add_resource(views.ArticlesView,'/articles/<article_id>')


# 关注用户
user_api.add_resource(views.ArticlesPDView,'/user/followings')

# 取消关注用户
user_api.add_resource(views.ArticlesPDView2,'/user/followings/<id>')



# 点赞
user_api.add_resource(views.ArticlesPoint,'/article/likings')
# 取消点赞
user_api.add_resource(views.ArticlesPoint2,'/article/likings/<id>')



# 喜欢文章
user_api.add_resource(views.ArticlesPointDislike,'/article/dislikes')


# 取消点赞
user_api.add_resource(views.ArticlesPointDislike2,'/article/dislikes/<id>')



# 收藏文章和取消收藏文章     用户收藏列表
user_api.add_resource(views.ArticlesCollect,'/article/collections')





# 发表评论   和      评论回复
user_api.add_resource(views.CommentView,'/comments')




# 用户历史
user_api.add_resource(views.HistoriesView,'/user/histories')




# 用户粉丝
user_api.add_resource(views.FollowView,'/user/followers')



# 关注用户列表
user_api.add_resource(views.AAA,'/user/followings')




